<?
//ini_set('include_path', '/home/koshtuc/pear/lib/php' . PATH_SEPARATOR . ini_get('include_path'));
require_once 'DB/Table.php';

class ArticlesTable extends DB_Table {
 var $col = array(
        
        // unique row ID
        'id' => array(
            'type'    => 'integer',
            'require' => true
        ),
        
        // first name
        'title' => array(
            'type'    => 'varchar',
            'size'    => 254
        ),
        
        // last name
        'description' => array(
            'type'    => 'CLOB'

        ),
        
        // email address
        'email' => array(
            'type'    => 'varchar',
            'size'    => 128,
            'require' => true
        ),
        
        // date-time signed
        'signdate' => array(
            'type'    => 'date',
            'require' => true
        )
    );

 var $idx = array(
        'id' => array(
            'type' => 'unique',
            'cols' => 'id'
        ),
        'signdate' => array(
            'type' => 'normal',
            'cols' => 'signdate'
        )
    );

var $sql = array(
        
        // multiple rows for a list
        'list' => array(
            'select' => "id, title, description, signdate, ",
            'order'  => 'signdate DESC'
        ),
        
        // one row for an item detail
        'item' => array(
            'select' => 'id, title, description, signdate',
            'get'    => 'row'
        ),
        
        // email => fullname (unique rows only)
        'emails' => array(
            'select' => "DISTINCT email, title, description",
            'order'  => 'lname, fname',
            'get'    => 'assoc'
        )
    );


}
?>